<template>
  <div class="app-container">
    <el-row :gutter="10">
      <!-- 字典 -->
      <el-col :span="12">
        <Dict @getDict="handlerGetDict" />
      </el-col>

      <!-- 字典子项 -->
      <el-col :span="12">
        <DictItem :dict-id="dictId" :dict-code="dictCode" />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Dict from './dict'
import DictItem from './dict-item'

export default {
  components: {
    Dict,
    DictItem
  },
  data() {
    return {
      dictId: undefined,
      dictCode: ''
    }
  },

  methods: {
    // 字典选择回调
    handlerGetDict(row) {
      this.dictId = row.id
      this.dictCode = row.code
    }
  }
}
</script>
